#include<iostream>
#include<pthread.h>
#include<vector>
#include<unistd.h>
using namespace std;
void*fun(void*args)
{

uint64_t num=(uint64_t)args;
cout<<"thread"<<num<<":isrunning"<<endl;
cout<<num<<endl;
return (void*)0;
}
int main()
{
vector<pthread_t>tids;
for(uint64_t i=0;i<10;i++)
{
  pthread_t tid;

pthread_create(&tid,nullptr,fun,(void*)i);
tids.push_back(tid);

sleep(2);
}
for(auto& tid:tids)
{

pthread_detach(tid);


}

for(uint64_t i=0;i<10;i++)
{
int n=pthread_join(tids[i],nullptr);
cout<<"is quit..."<<"n:"<<endl;

}









}
